Component({
  data: {
    isConnected: false, // 新增连接状态标识
    airole:'',
  },
  pageLifetimes:{
    show(){

    },
    hide(){

    }
  },
  methods:{
  // 按钮点击事件
  toggleButtonState() {
    console.log(this.airole)
    this.setData({
      isConnected: !this.data.isConnected
    });
  },
  ButtonState1() {
    const pages = getCurrentPages();
    const homePage = pages.find(page => page.route === 'pages/home/home');
    
    if (homePage) {
      homePage.setData({
        activePage: 'aiRole'
      });
      wx.navigateBack();
    }
  },
  ButtonState2() {
    const pages = getCurrentPages();
    const homePage = pages.find(page => page.route === 'pages/home/home');
    
    if (homePage) {
      homePage.setData({
        activePage: 'timbre'
      });
      wx.navigateBack();
    }
  },
  ButtonState3() {
    const pages = getCurrentPages();
    const homePage = pages.find(page => page.route === 'pages/home/home');
    
    if (homePage) {
      homePage.setData({
        activePage: 'system'
      });
      wx.navigateBack();
    }
  },
  }
});